package fenyu.personblob.web.model;

import fenyu.personblob.bean.databean.blob.Blob;
import fenyu.personblob.bean.databean.blob.BlobComment;
import fenyu.personblob.single.SinglePathDoor;

import java.util.ArrayList;
import java.util.List;

/**
 * create at 2018/12/22 11:49
 *
 * @author 纷羽 <gzj0078@gmail.com>
 */
public class BlobShow extends BlobShowSimple {

    private String text;

    private List<BlobShowComment> blobComments = new ArrayList<BlobShowComment>();

    public BlobShow(Blob blob) {
        super(blob);
        for (Integer comment : blob.getBlobComments()) {
            BlobComment b = SinglePathDoor.getSingleSave().getSaveDoor().getBlobCommentSavePath().getById(comment);
            if (b != null) {
                blobComments.add(new BlobShowComment(b));
            }
        }
        this.text = blob.getText();
    }

    public String getText() {
        return text;
    }

    public List<BlobShowComment> getBlobComments() {
        return blobComments;
    }

}
